// 版权归 瞄你个汪 所有。使用本代码应遵守相关法律法规和Apache 2.0开源许可要求。
package top.geeke.database.seed;

import top.geeke.constants.AppConstPool;
import top.geeke.entity.SysRole;
import top.geeke.eunm.SysDataScopeEnum;
import top.geeke.toolkit.supertable.seed.SuperSeedData;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 系统角色表种子数据
 * </p>
 *
 * @author 瞄你个汪
 * @since 2024/5/26 8:13
 */
public class SysRoleSeedData implements SuperSeedData<SysRole> {
    @Override
    public List<SysRole> getSeedData() {
        return new ArrayList<SysRole>(){{
            add(newInstance(1300000000101L, "系统管理员", "sys_admin", SysDataScopeEnum.All, "系统管理员", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000102L, "本部门及以下数据", "sys_deptChild", SysDataScopeEnum.DeptChild, "本部门及以下数据", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000103L, "本部门数据", "sys_dept", SysDataScopeEnum.Dept, "本部门数据", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000104L, "仅本人数据", "sys_self", SysDataScopeEnum.Self, "仅本人数据", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000105L, "自定义数据", "sys_define", SysDataScopeEnum.Define, "自定义数据", AppConstPool.PRIMARY_ID));
        }};
    }

    public SysRole newInstance(Long id, String name, String code, SysDataScopeEnum scope, String remark, Long tenantId) {
        SysRole role = new SysRole();
        role.setId(id);
        role.setRoleName(name);
        role.setRoleCode(code);
        role.setDataScope(scope);
        role.setRemark(remark);
        role.setTenantId(tenantId);
        return role;
    }
}
